package com.itheima.student;
import java.util.Scanner;
/**
 * 电影系统测试
 */
public class test5 {
    public static void main(String[] args) {
        //1、设计一个电影类
        //2、设计一个电影操作类
        //3、准备电影数据
        Movie5[] movies= new Movie5[4];
        movies[0] = new Movie5(1,"水门桥",38.9,9.8,"徐克","吴京","12万人想看");
        movies[1] = new Movie5( 2,"出拳吧",39,7.8,"唐晓白","田雨","3.5万人想看");
        movies[2]= new Movie5(3,"月球陨落",42,7.9,"罗兰","贝瑞","17.9万人想看");
        movies[3] = new Movie5(4,"一点就到家",35,8.7,"许宏字","刘吴然","10.8万人想看");

        //创建一个电影操作类的对象，接收电影数据，并处理
        MovieOperator5 operator = new MovieOperator5(movies);

        //电影信息系统
        Scanner rn = new Scanner(System.in);
        quit:
        while (true) {
            printmain();
            String command = rn.next();
            switch (command) {
                case "all"://显示全部电影信息
                    operator.printAllMoives();
                    break;
                case "search"://根据id查询电影信息
                    System.out.println("请您输入要查询的电影编号：");
                    int id = rn.nextInt();
                    operator.searchMovieById(id);
                    break;
                case "quit"://退出电影信息系统
                    System.out.println("已为您退出电影信息系统~");
                    break quit;
                default:
                    System.out.println("您输入的命令有问题~");
            }
        }
    }
    public static void printmain() {
        System.out.println("=========电影信息系统=========");
        System.out.println("--(all)-----显示全部电影信息");
        System.out.println("--(search)--根据id查询电影信息");
        System.out.println("--(quit)----退出电影信息系统");
        System.out.println("============================");
        System.out.println("请您输入要操作的命令：");
    }
}
